﻿using BluetoothMachine.Domains;
using BluetoothMachine.Enums;
using BluetoothMachine.GlobalStatics;
using BluetoothMachine.Services;
using BluetoothMachine.Views.DialogHosts;
using MaterialDesignThemes.Wpf;
using Prism.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace BluetoothMachine.ViewModels
{
    public class DeviceConfigurationViewModel
    {
        public string StartAddress { get; set; }
        public int StartProt { get; set; }
        public string EndAddress { get; set; }
        public int EndPort { get; set; }

        public DeviceManagementGlobal DeviceGlobal { get; set; }

        public DeviceConfigurationViewModel(DeviceManagementGlobal device)
        {
            DeviceGlobal = device;
        }

        public DelegateCommand AfterWeighingServer => new DelegateCommand(() => DeviceGlobal.AddDevices(StartAddress, StartProt.ToString(), EndAddress, EndPort.ToString()));

        public DelegateCommand SaveInit => new DelegateCommand(() => DeviceGlobal.Save() );
    }
}
